package com.demo.consumer.service.impl;

import com.demo.consumer.service.IStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class StockServiceImpl implements IStockService {

    @Value("${stock_provider_url}")
    String stockProviderUrl;

    @Autowired
    RestTemplate restTemplate;

    @Override
    public String sendProvider(String content) {
        String result = restTemplate.getForObject(stockProviderUrl + "/nsf/content?content=" + content, String.class);
        return result;
    }
}
